home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / lcppb.zip / LCPPLIB.ZIP / COMMAND.H next >
C/C++ Source or Header  |  1991-07-04  |  881b  |  28 lines

  1. // command.h -- Header for command.cpp
  2.  
  3. #ifndef __COMMAND_H
  4. #define __COMMAND_H  1     // Prevent multiple #includes
  5.  
  6. #include "stritem.h"
  7.  
  8. /* -- The abstract command class is an strItem with an associated
  9. action in the form of a "pure" virtual function. Selecting a command
  10. object derived from the command class calls the derived virtual
  11. function. With this design, all commands are objects, eliminating the
  12. need for the large switch statements typically found in menu-driven
  13. programs. */
  14.  
  15. class command : public strItem {
  16.   protected:
  17.     int cmdNum;    // Unique number to identify command
  18.   public:
  19.     command(const char *s, int cn = 0) : strItem(s) { cmdNum = cn; }
  20.     virtual void performCommand(void) = 0;
  21. };
  22.  
  23. #endif   // __COMMAND_H
  24.  
  25.  
  26. // Copyright (c) 1990 by Tom Swan. All rights reserved
  27. // Revision 1.00    Date: 10/25/1990   Time: 08:52 am
  28.